package com.spi.soconversion.base.definition;

import java.util.ArrayList;

/**
 * 
 * @author XSPID41
 *
 */
public class Order {

	private String billToID;	
	private String billToKey;
	private String documentType;
	private String enterpriseCode = "BAY";
	private String entryType = "STORE";
	private String orderDate;
	private String orderNo;
	private String sellerOrganizationCode;
	private String taxExemptFlag;
	private String taxExemptCertificate;
	private String shipToKey;
	
	private ArrayList<Line> linesList = new ArrayList<Line>();
	
	public boolean addLine(Line line) {
		boolean status = false;
		if (!linesList.contains(line)) {
			status = linesList.add(line);
		}
		return status;
	}

	public boolean removeLine(Line line) {
		boolean status = false;
		status = linesList.remove(line);
		return status;
	}

	public ArrayList<Line> getLinesList() {
		return linesList;
	}
	
	public String getBillToID() {
		return billToID;
	}
	
	public void setBillToID(String billToID) {
		this.billToID = billToID;
	}
	
	public String getDocumentType() {
		return documentType;
	}
	
	public void setDocumentType(String documentType) {
		this.documentType = documentType;
	}
	
	public String getEnterpriseCode() {
		return enterpriseCode;
	}
	
	public void setEnterpriseCode(String enterpriseCode) {
		this.enterpriseCode = enterpriseCode;
	}
	
	public String getEntryType() {
		return entryType;
	}
	
	public void setEntryType(String entryType) {
		this.entryType = entryType;
	}
	
	public String getOrderDate() {
		return orderDate;
	}
	
	public void setOrderDate(String orderDate) {
		this.orderDate = orderDate;
	}
	
	public String getOrderNo() {
		return orderNo;
	}
	
	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}
	
	public String getSellerOrganizationCode() {
		return sellerOrganizationCode;
	}
	
	public void setSellerOrganizationCode(String sellerOrganizationCode) {
		this.sellerOrganizationCode = sellerOrganizationCode;
	}
	
	public String getTaxExemptFlag() {
		return taxExemptFlag;
	}

	public void setTaxExemptFlag(String taxExemptFlag) {
		this.taxExemptFlag = taxExemptFlag;
	}

	public String getTaxExemptCertificate() {
		return taxExemptCertificate;
	}

	public void setTaxExemptCertificate(String taxExemptCertificate) {
		this.taxExemptCertificate = taxExemptCertificate;
	}

	public String getBillToKey() {
		return billToKey;
	}

	public void setBillToKey(String billToKey) {
		this.billToKey = billToKey;
	}

	public String getShipToKey() {
		return shipToKey;
	}

	public void setShipToKey(String shipToKey) {
		this.shipToKey = shipToKey;
	}

	@Override
	public String toString() {
        StringBuffer s = new StringBuffer();
        s.append("Order[" 
        			+ getOrderNo()
        			+ "/n" 
        			+ getBillToID()
        			+ "/n"
        			+ getBillToKey()
        			+ "/n"
        			+ getDocumentType()
        			+ "/n"
        			+ getEnterpriseCode()
        			+ "/n"
        			+ getEntryType()
        			+ "/n"
        			+ getOrderDate()
        			+ "/n"
        			+ getOrderNo()
        			+"/n"
        			+ getSellerOrganizationCode()
        			+ "/n"
        			+ getTaxExemptFlag()
        			+ "/n" 
        			+ getShipToKey()
        			+ "]");
        return s.toString();
    }
}